home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / cad / prtgl130.zip / HPGL.DOC < prev    next >
Text File  |  1993-04-14  |  24KB  |  609 lines

  1.  
  2.  
  3.                           PrintGL 1.30 HP-GL and ADI Commands
  4.  
  5.                       (C) Copyright Ravitz Software Inc. 1990,1993
  6.  
  7.  
  8.          Ravitz Software Inc.                              BBS/FAX 606-268-0577
  9.          P.O. Box 25068
  10.          Lexington, KY  40524-5068
  11.          USA                                  Compuserve Cary Ravitz [70431,32]
  12.  
  13.  
  14.          Introduction ....................................................... 2
  15.          ADI Commands                                                         2
  16.          HP-GL Commands                                                       3
  17.          HP-GL Character Sets .............................................. 13
  18.  
  19.                                                                             p-2
  20.          Introduction ---------------------------------------------------------
  21.  
  22.            This   document  is   a   description  of  the   subset   of   HP-GL
  23.            (Hewlett-Packard  Graphics  Language)  that is supported by PrintGL.
  24.            This  information was included in  PRINTGL.DOC with PrintGL 1.24 and
  25.            earlier shareware packages.  It is  now in a separate  file to  make
  26.            printing the PrintGL reference manual easier.
  27.  
  28.            If  you are using PrintGL to work with commercial graphics software,
  29.            then you will probably  not  need this manual.  If  you are  writing
  30.            HP-GL code you will find here  the information  needed to  make your
  31.            HP-GL compatible with PrintGL.
  32.  
  33.          ADI Commands ---------------------------------------------------------
  34.  
  35.            With the /YA option PrintGL can read Autodesk ADI 4.0 vector plotter
  36.            binary commands  intermixed  in the HP-GL.  The table shows each ADI
  37.            command  and  the  equivalent  HP-GL   command  (as  interpreted  by
  38.            PrintGL).  In  the ADI  code  column, the code number  and  "b"s are
  39.            bytes, and "x" and "y" are words.
  40.  
  41.              ADI command     ADI code     equivalent HP-GL
  42.  
  43.              begin plot      1 b          ignored
  44.              end plot        2            PG;
  45.              move            3 x y        PUx,y; (x,y <= 32767)
  46.              draw            4 x y        PDx,y; (x,y <= 32767)
  47.              pen             5 b          SPb;
  48.              speed           6 b          ignored
  49.              line type       7 b          if b=0 then LT else LTb;
  50.              raise pen       8            ignored
  51.              abort           9            ignored
  52.  
  53.            Six line types (other than solid) are supported.                    
  54.  
  55.                                                                             p-3
  56.          HP-GL Commands -------------------------------------------------------
  57.  
  58.            PrintGL's HP-GL specification is taken from the  programming manuals
  59.            for the HP 7475A, ColorPro (7440/17440), and 7550A.  The 7550 manual
  60.            is  the  best reference for HP-GL - HP  manual 07550-90001.  PrintGL
  61.            supports  the 7475, and 7440/17440 command sets except for character
  62.            set 8 (Katakana), digitize commands, output commands, the error mask
  63.            command, and some device control  commands.  Supported commands  are
  64.            listed below.  Commands that are not applicable to printing, such as
  65.            pen velocity, are  considered supported  but are completely ignored.
  66.            Commands that are not supported are flagged and then ignored.
  67.  
  68.            In addition, PG,  AF, ES, LO, the enhanced IW command, character set
  69.            5, and proportional spaced fonts, from the 7550, are supported.  And
  70.            forty pens are allowed instead of eight.
  71.  
  72.            In reading a plotfile, PrintGL ignores carriage returns, line feeds,
  73.            and nulls  except where  they may be valid characters (LB,  SM,  DT,
  74.            esc.), and ASCII EOF (026) is interpreted as an end of file mark.
  75.  
  76.            AA x_center , y_center , arc_angle [, chord_angle]
  77.  
  78.              arc absolute
  79.  
  80.              AA moves the pen through an arc, starting at the current position,
  81.              with the pen in the current up/down state.
  82.  
  83.            AF
  84.  
  85.              advance full page (7550 extension)
  86.  
  87.              AF starts a new plot. PrintGL starts every page with the pen up at
  88.              0,0.
  89.  
  90.            AP
  91.  
  92.              automatic pen pickup - IGNORED
  93.  
  94.            AR x_center_delta , y_center_delta , arc_angle [, chord_angle]
  95.  
  96.              arc relative
  97.  
  98.              AR moves the pen through an arc, starting at the current position,
  99.              with the pen in the current up/down state.
  100.  
  101.            CA character_set
  102.  
  103.              designate alternate character set
  104.  
  105.              See HP-GL Character Sets for a list of character sets.
  106.  
  107.            CI radius [, chord_angle]
  108.  
  109.              circle
  110.  
  111.              CI draws a  circle centered at the current position.  The  current
  112.              up/down state and position are unchanged by a CI command.         
  113.  
  114.                                                                             p-4
  115.            CP [spaces , lines]
  116.  
  117.              character plot
  118.  
  119.              CP  moves  the  pen by character spaces (+ is  along the text) and
  120.              lines  (+  is  up),  using  the current up/down  state.  Using  no
  121.              parameters is the same as a carriage return/line feed.
  122.  
  123.            CS character_set
  124.  
  125.              designate standard character set
  126.  
  127.              See HP-GL Character Sets for a list of character sets.
  128.  
  129.            DF
  130.  
  131.              default values
  132.  
  133.              This sets default values for the following commands:  CA,  CS, DR,
  134.              DT, ES, FT, IW, LO, LT, PA, PT, SC, SM, SL, SR, SS, TL.
  135.  
  136.            DI [run , rise]
  137.  
  138.              absolute character direction
  139.  
  140.              DI sets the baseline direction for labels.  The default is 1,0.
  141.  
  142.            DR [run , rise]
  143.  
  144.              relative character direction
  145.  
  146.              DR  sets the baseline  direction  for labels.  Run  and rise are a
  147.              percentage of P2X-P1X and P2Y-P1Y. The default is 1,0.
  148.  
  149.            DTt
  150.  
  151.              define label terminator
  152.  
  153.              The label terminator ends an LB command. The default is ASCII 003.
  154.  
  155.            EA x_opposite_corner , y_opposite_corner
  156.  
  157.              edge rectangle absolute
  158.  
  159.              EA  draws a  rectangle defined  by  the  current position  and the
  160.              parameters. The pen position and up/down state are unchanged.
  161.  
  162.            EC
  163.  
  164.              enable cutter - IGNORED
  165.  
  166.            EP
  167.  
  168.              edge polygon
  169.  
  170.              EP draws  the  current  polygon  edge.  Any  pen  up/down used  in
  171.              creating the polygon is respected in drawing the edge.            
  172.  
  173.                                                                             p-5
  174.            ER x_opposite_corner_delta , y_opposite_corner_delta
  175.  
  176.              edge rectangle relative
  177.  
  178.              ER draws a rectangle with corners defined  by the current position
  179.              and the command  parameters.  The current pen position and up/down
  180.              state are unchanged.
  181.  
  182.            ES [ space [, line]]
  183.  
  184.              extra space (7550 extension)
  185.  
  186.              ES adds to the space between characters and  lines.  The units are
  187.              in character cells (1.5*width, 2*height).  The allowed range is -1
  188.              to 1. -.3333 causes characters to touch.
  189.  
  190.            EW radius , start_angle , sweep_angle [, chord_angle]
  191.  
  192.              edge wedge
  193.  
  194.              EW draws a wedge centered at the current position. The current pen
  195.              position and up/down state are unchanged.
  196.  
  197.            FP
  198.  
  199.              fill polygon
  200.  
  201.              FP  fills  the  current  polygon.  Pen up/down  commands  used  in
  202.              creating the polygon are ignored.
  203.  
  204.              There is a limit of 2000 fill line segments per polygon.
  205.  
  206.            FT [type [, spacing [, angle]]]
  207.  
  208.              fill type
  209.  
  210.              These are  the  fill types.  Type  2  is identical to  type 1  for
  211.              PrintGL.
  212.  
  213.                1  solid lines spaced at half the pen thickness (see PT command)
  214.                2  unidirectional solid lines spaced at half the pen thickness
  215.                3  lines at the specified spacing
  216.                4  cross hatched lines at the specified spacing
  217.                5  type ignored
  218.  
  219.              A spacing  parameter  of 0 sets  the  spacing  to 1%  of the P1-P2
  220.              diagonal. Spacing is in x axis units (this is only relevant if the
  221.              axes have different scaling).  PrintGL supports any  integer angle
  222.              for fill. Cross hatched lines are at angle + 90.
  223.  
  224.            IN
  225.  
  226.              initialize                                                        
  227.  
  228.                                                                             p-6
  229.            IP [p1x , p1y [, p2x , p2y]]
  230.  
  231.              sets scaling points P1 and P2
  232.  
  233.              IP sets the scaling points (P1 and P2) in plotter units. P1 and P2
  234.              are used by several commands to help with size independent plots.
  235.  
  236.            IW [x_lower_left , y_lower_left , x_upper_right , y_upper_right]
  237.  
  238.              input window
  239.  
  240.              IW sets a  clipping window in plotter units.  With  no parameters,
  241.              the clipping window is turned off.
  242.  
  243.              If  PrintGL's  /YE switch is  set and user  scaling  is on then IW
  244.              parameters are in user units.  In this case the window is rescaled
  245.              with an IP command, but any SC command locks the current window.
  246.  
  247.            LB..text..terminator
  248.  
  249.              label
  250.  
  251.              Labels use  the current character set, based on CA, CS, SA, and SS
  252.              commands. See HP-GL Character Sets for font specifics.
  253.  
  254.            LO [ position_number ]
  255.  
  256.              label origin (7550 extension)
  257.  
  258.              LO sets the label origin.  The label origin relative to the  label
  259.              is  shown in the diagram below.  For positions 4..9 and 14..19 the
  260.              label buffer is limited to 150 characters. The default is 1.
  261.  
  262.              13                     16                      19
  263.                 3......  .......  ...6...  .......  ......9
  264.                 .     .  .     .  .     .  .     .  .     .
  265.              12 2     .  .     .  .  5  .  .     .  .     8 18
  266.                 .     .  .     .  .     .  .     .  .     .
  267.                 1......  .......  ...4...  .......  ......7
  268.              11                     14                      17
  269.  
  270.            LT [pattern_number [, pattern_length]]
  271.  
  272.              line type
  273.  
  274.              PrintGL's line type  patterns  are close to, but  not identical to
  275.              HP's.  Pattern length is a percentage of the P1-P2 diagonal with a
  276.              default  of 4%  and a minimum  of 4 dots for types  1 and 2 and 16
  277.              dots for other types.
  278.  
  279.              no parameter  solid            1  ∙               ∙
  280.                                             2  ────────        ────────
  281.              0             dots at          3  ────────────    ────────────
  282.                            endpoints        4  ────────────  ∙ ────────────  ∙
  283.                            only             5  ──────────  ──  ──────────  ──
  284.                                             6  ──────  ──  ──  ──────  ──  ──  
  285.  
  286.                                                                             p-7
  287.            PA [x , y] [, x , y] ...
  288.  
  289.              plot absolute
  290.  
  291.              PA sets absolute mode and optionally moves the  pen in the current
  292.              up/down state.
  293.  
  294.            PD [x , y] [, x , y] ...
  295.  
  296.              pen down
  297.  
  298.              PD sets  the pen  down and optionally  moves  it with  the current
  299.              absolute/relative mode.
  300.  
  301.            PG [i]
  302.  
  303.              new page (7550 extension)
  304.  
  305.              PG starts  a new  plot.  The parameter is ignored.  PrintGL starts
  306.              every page with the pen up at 0,0.
  307.  
  308.            PM i
  309.  
  310.              polygon mode
  311.  
  312.              PM 0 starts polygon mode.  The current position is the first point
  313.              in the polygon.
  314.  
  315.              PM 1 starts  a new  subpolygon.  The  position after the next  pen
  316.              movement is the first point in the subpolygon.  The first pen move
  317.              of a subpolygon is done with the pen up, regardless of the current
  318.              up/down status.
  319.  
  320.              PM 2 ends polygon mode.
  321.  
  322.              PM  1 and PM 2 close  the current subpolygon with  the current pen
  323.              up/down state. If used without first starting polygon mode (PM 0),
  324.              PrintGL adds an implied PM 0 before processing the PM 1 or PM 2.
  325.  
  326.              The following  commands are accepted in polygon  mode: PM, PA, PR,
  327.              PU, PD,  AA,  AR,  CI  (circles  are  automatically  prefixed  and
  328.              suffixed by PM 1), and IN (ends polygon mode).
  329.  
  330.              The polygon buffer is limited to 500 data points.
  331.  
  332.            PR [x_delta , y_delta] [, x_delta , y_delta] ...
  333.  
  334.              plot relative
  335.  
  336.              PR sets relative mode and optionally moves the  pen in the current
  337.              up/down state.
  338.  
  339.            PS
  340.  
  341.              paper size - IGNORED
  342.  
  343.              PrintGL ignores PS. The paper size must be set with the /L option.
  344.  
  345.                                                                             p-8
  346.            PT [thickness]
  347.  
  348.              pen thickness
  349.  
  350.              PT specifies twice the line spacing used in solid fills and may be
  351.              from 0 to 5.0 mm. It is reset to .3 mm with each SP command.
  352.  
  353.            PU [x,y] [,x,y] ...
  354.  
  355.              pen up
  356.  
  357.              PU  raises  the  pen  and  optionally  moves it with  the  current
  358.              absolute/relative mode.
  359.  
  360.            RA x_opposite_corner , y_opposite_corner
  361.  
  362.              shade rectangle absolute
  363.  
  364.              RA  fills a rectangle with corners defined by the current position
  365.              and the command parameters.  The current pen  position and up/down
  366.              state are unchanged. The rectangle edge is not drawn.
  367.  
  368.            RO [angle]
  369.  
  370.              rotated coordinate system
  371.  
  372.              RO or RO0 sets up a normal coordinate system. RO90, the only other
  373.              allowed  value, sets up a system that is rotated  90 degrees.  The
  374.              type of rotation depends on the paper size.  This command does not
  375.              change the scaling points, so an IP command is useful after an RO.
  376.  
  377.              The HP 7475 specifies two different meanings for RO90 depending on
  378.              the  paper  size (A/A4 or B/A3).  PrintGL  decides  which  type of
  379.              rotation to do based on the sum of  the  print  window  width  and
  380.              height.  If this sum  is  greater than 24 inches  then large paper
  381.              rotation is used. Otherwise, small paper rotation is used.
  382.  
  383.              Small paper rotation:              Large paper rotation:
  384.  
  385.              RO 0             RO 90             RO 0             RO 90
  386.  
  387.                y┌────────┐   0,0┌────────┐y     0,0┌────────┐y    y┌────────┐
  388.                 │        │      │        │         │        │      │        │
  389.                 │        │      │        │         │        │      │        │
  390.              0,0└────────┘x    x└────────┘         │        │      │        │
  391.                                                    │        │      │        │
  392.                                                    │        │      │        │
  393.                                                    │        │      │        │
  394.                                                   x└────────┘   0,0└────────┘x
  395.  
  396.            RR x_opposite_corner_delta , y_opposite_corner_delta
  397.  
  398.              shade rectangle relative
  399.  
  400.              RR  fills a rectangle with corners defined by the current position
  401.              and the command parameters.  The current pen  position and up/down
  402.              state are unchanged. The rectangle edge is not drawn.             
  403.  
  404.                                                                             p-9
  405.            SA
  406.  
  407.              select alternate character set
  408.  
  409.              SA specifies the alternate character set as current. The alternate
  410.              character set is chosen with CA.
  411.  
  412.            SC [xmin , xmax , ymin , ymax]
  413.  
  414.              scaling
  415.  
  416.              SC  sets user units for subsequent drawing.  The units are defined
  417.              by  user values for P1 (xmin,ymin)  and  P2 (xmax,ymax).  Using no
  418.              parameters  turns  scaling off, and  subsequent drawing is done in
  419.              plotter units (1/1016 inch).
  420.  
  421.            SI [width , height]
  422.  
  423.              character size absolute
  424.  
  425.              SI sets the capital letter  box  width and height  in centimeters.
  426.              Letter  spacing  is  1.5  *  width and line spacing is 2 * height.
  427.              Using no parameters with B or A3 paper is the  same as SI.285,.375
  428.              and any other paper is the same as SI.187,.269.
  429.  
  430.            SL [tan_angle]
  431.  
  432.              character slant
  433.  
  434.              SL sets the character slant.  The parameter is  interpreted as the
  435.              tangent  of  the angle from vertical.  Using no parameter sets the
  436.              slant to 0 degrees.
  437.  
  438.            SM[c]
  439.  
  440.              symbol mode
  441.  
  442.              SM  sets symbol  mode, which centers  the symbol mode character at
  443.              any plotted point.  Any character from ASCII 033 to 127 except ";"
  444.              sets symbol mode. Any other character turns symbol mode off.
  445.  
  446.            SP pen_number
  447.  
  448.              select pen
  449.  
  450.              SP selects a pen.  Using 0 or no parameter stores the pen  without
  451.              selecting a new pen.  This is usually done at the  end of a  plot.
  452.              PrintGL ignores any drawing with pen 0.
  453.  
  454.            SR [width , height]
  455.  
  456.              character size relative
  457.  
  458.              SR sets the capital letter box width and height as a percentage of
  459.              P2X-P1X  and P2Y-P1Y.  Letter  spacing is 1.5  *  width  and  line
  460.              spacing  is  2  *  height.  Using no  parameters  is the  same  as
  461.              SR.75,1.5.                                                        
  462.  
  463.                                                                            p-10
  464.            SS
  465.  
  466.              select standard character set
  467.  
  468.              SS specifies the standard character  set as current.  The standard
  469.              character set is chosen with CS.
  470.  
  471.            TL [positive_length [, negative length]]
  472.  
  473.              tick length
  474.  
  475.              TL sets the tick lengths  used by XT and YT.  The  parameters  are
  476.              lengths above  and  below the current position as a  percentage of
  477.              P2Y-P1Y for x-axis ticks and  a percentage of  P2X-P1X  for y-axis
  478.              ticks.
  479.  
  480.            UC [[pen_control ,] x_delta , y_delta] ...
  481.  
  482.              user character
  483.  
  484.              UC specifies  a user defined character.  The pen control number is
  485.              99 for pen down  or -99  for pen  up.  Pen movements are relative,
  486.              with x_delta in  units  of 1/4 the character  width and y_delta in
  487.              units of 1/8 the character height.
  488.  
  489.            VA
  490.  
  491.              adaptive velocity - IGNORED
  492.  
  493.            VN
  494.  
  495.              normal velocity - IGNORED
  496.  
  497.            VS
  498.  
  499.              pen velocity - IGNORED
  500.  
  501.            WG radius , start_angle , sweep_angle [, chord_angle]
  502.  
  503.              shade wedge
  504.  
  505.              WG fills a wedge centered at the current position. The current pen
  506.              position and up/down  state are unchanged.  The wedge  edge is not
  507.              drawn.
  508.  
  509.            XT
  510.  
  511.              x-axis tick
  512.  
  513.              XT draws a vertical line, with length specified by the TL command,
  514.              at  the current position.  The pen position  and up/down state are
  515.              unchanged.                                                        
  516.  
  517.                                                                            p-11
  518.            YT
  519.  
  520.              y-axis tick
  521.  
  522.              YT draws  a  horizontal  line,  with length  specified  by  the TL
  523.              command, at the  current position.  The  pen position  and up/down
  524.              state are unchanged.
  525.  
  526.            esc.(
  527.            esc.Y
  528.  
  529.              plotter on
  530.  
  531.              Esc.(  and esc.Y turn the plotter on.  This is only relevant  with
  532.              the /YY option.
  533.  
  534.            esc.)
  535.            esc.Z
  536.  
  537.              plotter off
  538.  
  539.              Esc.) and esc.Z turn the plotter off. They are only effective with
  540.              the /YY option.  The plotter on  and off commands let you  include
  541.              comments  or  data  to  pass through  to  another  device  in  the
  542.              plotfile. These are flagged as unsupported commands if /YD is set,
  543.              as an indication that you should set /YY.
  544.  
  545.            esc.@, esc.H, esc.I, esc.M, esc.N, esc.R
  546.  
  547.              RS-232 device control commands - IGNORED                          
  548.  
  549.                                                                            p-12
  550.          HP-GL Character Sets -------------------------------------------------
  551.  
  552.            PrintGL  supports all of the character sets that  are included  with
  553.            the HP 7475 and 7440/17440 except Katakana, and adds character set 5
  554.            and  the  proportional  spaced  fonts   from  the  7550.   PrintGL's
  555.            characters are similar to but not identical to HP's.
  556.  
  557.               0  ANSI ASCII
  558.               1  9825 character set
  559.               2  French/German
  560.               3  Scandinavian
  561.               4  Spanish/Latin American
  562.               5  Special Symbols (7550 extension)
  563.               6  JIS ASCII
  564.               7  Roman Extensions
  565.               8  Katakana - NOT SUPPORTED BY PRINTGL
  566.               9  ISO IRV (International Reference Version)
  567.              30  ISO Swedish
  568.              31  ISO Swedish For Names
  569.              32  ISO Norway Version 1
  570.              33  ISO German
  571.              34  ISO French
  572.              35  ISO United Kingdom
  573.              36  ISO Italian
  574.              37  ISO Spanish
  575.              38  ISO Portuguese
  576.              39  ISO Norway Version 2
  577.  
  578.            The character sets specify a font for codes 033..127. Codes 000..032
  579.            and 128..255 are independent of the character set and are all no ops
  580.            except these.
  581.  
  582.              003  default label terminator
  583.              008  backspace
  584.              009  half backspace
  585.              010  line feed
  586.              011  reverse line feed
  587.              013  carriage return
  588.              014  select alternate character set
  589.              015  select standard character set
  590.              032  space
  591.  
  592.            Each of  the  character sets  is available as a proportional font by
  593.            adding 10 to the set number.  The proportional  fonts  are kerned to
  594.            improve  appearance (the character spacing is adjusted to compensate
  595.            for  character shape).  Use the LO  command to simplify working with
  596.            proportional fonts. To improve the appearance of large text, use the
  597.            ES command to reduce the character spacing.
  598.  
  599.            Codes 65 to 81 in character set 5 are symbols designed to be used in
  600.            symbol mode (SM command) or as one character labels.  When used in a
  601.            label (LB command) these characters  are centered at the current pen
  602.            position and leave the pen position unchanged.                      
  603.  
  604.                                                                            p-13
  605.            The  HP-GL  characters cannot  be printed  with  the  standard ASCII
  606.            character  set.  The file HPGL.CHR is an HP-GL file that can be used
  607.            to print a  replacement  for this page, showing  the character sets.
  608.            Use  the command PRINTGL  HPGL.CHR  /M1  /AO0,0  with  a  /F  option
  609.            specific to your printer to do this.